<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*
<span class='line'>  2</span>  * Timemap.js Copyright 2010 Nick Rabinowitz.
<span class='line'>  3</span>  * Licensed under the MIT License (see LICENSE.txt)
<span class='line'>  4</span>  */</span><span class="WHIT">
<span class='line'>  5</span> 
<span class='line'>  6</span> </span><span class="COMM">/**
<span class='line'>  7</span>  * @fileOverview
<span class='line'>  8</span>  * This file defines the Param class, which is used to get, set, and serialize
<span class='line'>  9</span>  * different fields on TimeMap and TimeMapItem objects.
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * @author Nick Rabinowitz (www.nickrabinowitz.com)
<span class='line'> 12</span>  */</span><span class="WHIT">
<span class='line'> 13</span> 
<span class='line'> 14</span> </span><span class="COMM">// save a few bytes</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 16</span> 
<span class='line'> 17</span> </span><span class="COMM">/**
<span class='line'> 18</span>  * @name TimeMap.params
<span class='line'> 19</span>  * @namespace Namespace for parameter classes
<span class='line'> 20</span>  */</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">TimeMap.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'> 23</span>      * @class
<span class='line'> 24</span>      * A parameter, with methods to get, set, and serialize the current value.
<span class='line'> 25</span>      *
<span class='line'> 26</span>      * @constructor
<span class='line'> 27</span>      * @param {String} paramName        String name of the parameter
<span class='line'> 28</span>      * @param {Object} options          Container for named arguments
<span class='line'> 29</span>      * @param {String} [sourceName]             String name of the source element, if different
<span class='line'> 30</span>      * @param {Function} [options.get]          Function to get the current param value
<span class='line'> 31</span>      * @param {Function} [options.set]          Function to set the param to a new value
<span class='line'> 32</span>      * @param {Function} [options.setConfig]    Function to set a new value in a config object
<span class='line'> 33</span>      * @param {Function} [options.fromStr]      Function to parse the value from a string
<span class='line'> 34</span>      * @param {Function} [options.toStr]        Function to serialize the current value to a string
<span class='line'> 35</span>      * @param {Function} [options.setConfigXML] Function to parse the value from an XML node and set to config
<span class='line'> 36</span>      */</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">    </span><span class="NAME">Param</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">param</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">        </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">        
<span class='line'> 41</span>         </span><span class="COMM">/**
<span class='line'> 42</span>          * String name of this param
<span class='line'> 43</span>          * @name TimeMap.params.Param#paramName
<span class='line'> 44</span>          * @type String
<span class='line'> 45</span>          */</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">        </span><span class="NAME">param.paramName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">        
<span class='line'> 48</span>         </span><span class="COMM">/**
<span class='line'> 49</span>          * String name of the source element, if different
<span class='line'> 50</span>          * @name TimeMap.params.Param#sourceName
<span class='line'> 51</span>          */</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">        </span><span class="NAME">param.sourceName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.sourceName</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">    
<span class='line'> 54</span>         </span><span class="COMM">/**
<span class='line'> 55</span>          * Get the current state value from a TimeMap or TimeMapItem object
<span class='line'> 56</span>          * @name TimeMap.params.Param#get
<span class='line'> 57</span>          * @function
<span class='line'> 58</span>          *
<span class='line'> 59</span>          * @param {TimeMap|TimeMapItem} o       Object to inspect
<span class='line'> 60</span>          * @return {mixed}                      Current state value
<span class='line'> 61</span>          */</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">        </span><span class="NAME">param.get</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.get</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">        
<span class='line'> 64</span>         </span><span class="COMM">/**
<span class='line'> 65</span>          * Set the current state value on a TimeMap or TimeMapItem object
<span class='line'> 66</span>          * @name TimeMap.params.Param#set
<span class='line'> 67</span>          * @function
<span class='line'> 68</span>          *
<span class='line'> 69</span>          * @param {TimeMap|TimeMapItem} o       Object to modify
<span class='line'> 70</span>          * @param {mixed} value                 Value to set
<span class='line'> 71</span>          */</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">        </span><span class="NAME">param.set</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.set</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">        
<span class='line'> 74</span>         </span><span class="COMM">/**
<span class='line'> 75</span>          * Set a new value on a config object for TimeMap.init()
<span class='line'> 76</span>          * @name TimeMap.params.Param#setConfig
<span class='line'> 77</span>          * @function
<span class='line'> 78</span>          * @see TimeMap.init
<span class='line'> 79</span>          *
<span class='line'> 80</span>          * @param {Object} config   Config object to modify
<span class='line'> 81</span>          * @param {mixed} value     Value to set
<span class='line'> 82</span>          */</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">        </span><span class="NAME">param.setConfig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.setConfig</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">            </span><span class="COMM">// default: set at top level</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">            </span><span class="NAME">config</span><span class="PUNC">[</span><span class="NAME">paramName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">        
<span class='line'> 88</span>         </span><span class="COMM">/**
<span class='line'> 89</span>          * Parse a state value from a string
<span class='line'> 90</span>          * @name TimeMap.params.Param#fromString
<span class='line'> 91</span>          * @function
<span class='line'> 92</span>          *
<span class='line'> 93</span>          * @param {String} s        String to parse
<span class='line'> 94</span>          * @return {mixed}          Current state value
<span class='line'> 95</span>          */</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">        </span><span class="NAME">param.fromString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.fromStr</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT">            </span><span class="COMM">// default: param is a string</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">        
<span class='line'>101</span>         </span><span class="COMM">/**
<span class='line'>102</span>          * Serialize a state value as a string
<span class='line'>103</span>          * @name TimeMap.params.Param#toString
<span class='line'>104</span>          * @function
<span class='line'>105</span>          *
<span class='line'>106</span>          * @param {mixed} value     Value to serialize
<span class='line'>107</span>          * @return {String}         Serialized string
<span class='line'>108</span>          */</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT">        </span><span class="NAME">param.toString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.toStr</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">            </span><span class="COMM">// default: use the built-in string method</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>115</span>          * Get the current value as a string
<span class='line'>116</span>          * @name TimeMap.params.Param#getString
<span class='line'>117</span>          * @function
<span class='line'>118</span>          * 
<span class='line'>119</span>          * @param {TimeMap|TimeMapItem} o       Object to inspect
<span class='line'>120</span>          */</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">        </span><span class="NAME">param.getString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">            </span><span class="NAME">param.toString</span><span class="PUNC">(</span><span class="NAME">param.get</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT">        
<span class='line'>125</span>         </span><span class="COMM">/**
<span class='line'>126</span>          * Set the current state value from a string
<span class='line'>127</span>          * @name TimeMap.params.Param#setString
<span class='line'>128</span>          * @function
<span class='line'>129</span>          * 
<span class='line'>130</span>          * @param {TimeMap|TimeMapItem} o       Object to modify
<span class='line'>131</span>          * @param {String} s                    String version of value to set
<span class='line'>132</span>          */</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">        </span><span class="NAME">param.setString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">            </span><span class="NAME">param.set</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">param.fromString</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>138</span>          * Set a config object based on an XML tag
<span class='line'>139</span>          * @name TimeMap.params.Param#setConfigXML
<span class='line'>140</span>          * @function
<span class='line'>141</span>          * 
<span class='line'>142</span>          * @param {Object} config       Config object to modify
<span class='line'>143</span>          * @param {XML NodeList} node   Parent node of the desired tag
<span class='line'>144</span>          */</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">        </span><span class="NAME">param.setConfigXML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.setConfigXML</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">node</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tagName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">param.sourceName</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">                </span><span class="NAME">nameParts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tagName.split</span><span class="PUNC">(</span><span class="STRN">':'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'>148</span>                 </span><span class="NAME">ns</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">            </span><span class="COMM">// deal with namespaced tags</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nameParts.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT">                </span><span class="NAME">tagName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nameParts</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">                </span><span class="NAME">ns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nameParts</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT">            </span><span class="COMM">// set to config</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">            </span><span class="NAME">param.setConfig</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">TimeMap.util.getTagValue</span><span class="PUNC">(</span><span class="NAME">node</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tagName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ns</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>158</span> 
<span class='line'>159</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>160</span>      * @class
<span class='line'>161</span>      * A convenience class for those parameters which deal with a value
<span class='line'>162</span>      * in the options of a TimeMap or TimeMapItem object, setting some
<span class='line'>163</span>      * additional default functions.
<span class='line'>164</span>      *
<span class='line'>165</span>      * @augments TimeMap.params.Param
<span class='line'>166</span>      *
<span class='line'>167</span>      * @constructor
<span class='line'>168</span>      * @param {String} paramName        String name of the option parameter
<span class='line'>169</span>      * @param {Object} [options]        Container for named arguments (see {@link TimeMap.params.Param})
<span class='line'>170</span>      */</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT">    </span><span class="NAME">OptionParam</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">        </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">defaults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>176</span>              * Get the current state value from the opts object of a TimeMap or TimeMapItem
<span class='line'>177</span>              * @name TimeMap.params.OptionParam#get
<span class='line'>178</span>              * @function
<span class='line'>179</span>              *
<span class='line'>180</span>              * @param {TimeMap|TimeMapItem} o       Object to inspect
<span class='line'>181</span>              * @return {mixed}                      Current state value
<span class='line'>182</span>              */</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">            </span><span class="NAME">get</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">o.opts</span><span class="PUNC">[</span><span class="NAME">paramName</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>188</span>              * Set the state value in the opts object of a TimeMap or TimeMapItem
<span class='line'>189</span>              * @name TimeMap.params.OptionParam#set
<span class='line'>190</span>              *
<span class='line'>191</span>              * @param {TimeMap|TimeMapItem} o       Object to modify
<span class='line'>192</span>              * @param {mixed} value                 Value to set
<span class='line'>193</span>              */</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT">            </span><span class="NAME">set</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">                </span><span class="NAME">o.opts</span><span class="PUNC">[</span><span class="NAME">paramName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>199</span>              * Set a new value on a config object for TimeMap.init() or a particular item
<span class='line'>200</span>              * @name TimeMap.params.OptionParam#setConfig
<span class='line'>201</span>              * @function
<span class='line'>202</span>              *
<span class='line'>203</span>              * @param {Object} config   Config object to modify
<span class='line'>204</span>              * @param {mixed} value     Value to set
<span class='line'>205</span>              */</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">            </span><span class="NAME">setConfig</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">                </span><span class="NAME">config.options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">config.options</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">                </span><span class="NAME">config.options</span><span class="PUNC">[</span><span class="NAME">paramName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">        </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.extend</span><span class="PUNC">(</span><span class="NAME">defaults</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">params.Param</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>215</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> 
<span class='line'>217</span> 
<span class='line'>218</span> </span><span class="COMM">/*----------------------------------------------------------------------------
<span class='line'>219</span>  * TimeMapItem params
<span class='line'>220</span>  *---------------------------------------------------------------------------*/</span><span class="WHIT">
<span class='line'>221</span> 
<span class='line'>222</span> </span><span class="COMM">/**
<span class='line'>223</span>  * @namespace Namespace for parameters used for loading data into a TimeMapItem 
<span class='line'>224</span>  * object. Because these are intended for loading, only setConfig is defined.
<span class='line'>225</span>  */</span><span class="WHIT">
<span class='line'>226</span> </span><span class="NAME">TimeMap.loaders.base.prototype.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>228</span>      * Item title
<span class='line'>229</span>      * @type TimeMap.params.Param
<span class='line'>230</span>      */</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">    </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">params.Param</span><span class="PUNC">(</span><span class="STRN">"title"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">    
<span class='line'>233</span>     </span><span class="COMM">/**
<span class='line'>234</span>      * Item start date
<span class='line'>235</span>      * @type TimeMap.params.Param
<span class='line'>236</span>      */</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT">    </span><span class="NAME">start</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">params.Param</span><span class="PUNC">(</span><span class="STRN">"start"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">    
<span class='line'>239</span>     </span><span class="COMM">/**
<span class='line'>240</span>      * Item end date
<span class='line'>241</span>      * @type TimeMap.params.Param
<span class='line'>242</span>      */</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">    </span><span class="NAME">end</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">params.Param</span><span class="PUNC">(</span><span class="STRN">"end"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">    
<span class='line'>245</span>     </span><span class="COMM">/**
<span class='line'>246</span>      * Item description
<span class='line'>247</span>      * @type TimeMap.params.OptionParam
<span class='line'>248</span>      */</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT">    </span><span class="NAME">description</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">params.OptionParam</span><span class="PUNC">(</span><span class="STRN">"description"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT">    
<span class='line'>251</span>     </span><span class="COMM">/**
<span class='line'>252</span>      * Item latitude
<span class='line'>253</span>      * @type TimeMap.params.Param
<span class='line'>254</span>      */</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">    </span><span class="NAME">lat</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">params.Param</span><span class="PUNC">(</span><span class="STRN">"lat"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">        </span><span class="NAME">setConfig</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">            </span><span class="NAME">config.point</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">config.point</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">            </span><span class="NAME">config.point.lat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">    
<span class='line'>262</span>     </span><span class="COMM">/**
<span class='line'>263</span>      * Item longitude
<span class='line'>264</span>      * @type TimeMap.params.Param
<span class='line'>265</span>      */</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT">    </span><span class="NAME">lon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">params.Param</span><span class="PUNC">(</span><span class="STRN">"lon"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT">        </span><span class="NAME">setConfig</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT">            </span><span class="NAME">config.point</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">config.point</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">            </span><span class="NAME">config.point.lon</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>272</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>273</span> 
<span class='line'>274</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span></pre></body></html>